<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>测体重</title>
    <script>
      var height = parseFloat(prompt("请输入您的身高(单位：cm)", "176"));
      var weigth = parseFloat(prompt("请输入您的体重(单位：斤)", "120"));
      //计算标准体重
      var standardWeigth = (height - 108) * 2;
      if (weigth - standardWeigth > 10) {
        alert("您的体重超重");
      } else if (weigth - standardWeigth < -10) {
        alert("您的体重偏瘦");
      } else {
        alert("您的体重是标准体重");
      }
    </script>
  </head>
  <body></body>
</html>
